<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
<jsp:include page="../header.jsp">
	<jsp:param value="学员缴费" name="title" />
</jsp:include>
<script type="text/javascript"
	src="${basePath }My97DatePicker/WdatePicker.js"></script>
	
<link href="static/css/couselor.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="static/js/total.js">
	
</script>
<script type="text/javascript">
	dow();
	function searchTime() {
		$('#submit').attr("disabled", "disabled");
		var $start = $('#start');
		var $end = $('#end');
		if ($start.val() > $end.val()) {
			alert("起止时间大于结束时间！")
		} else {
			$('#submit').removeAttr("disabled");
		}
	}
	function search() {
		var $start = $('#start');
		var $end = $('#end');
		if ($start.val().length == 0 && $end.val().length > 0
				|| $end.val().length == 0 && $start.val().length > 0) {
			if ($end.val().length == 0) {
				$('#submit').attr("disabled", "disabled");
				alert("请输入结束时间！");
			} else {
				if ($start.val() > $end.val()) {
					$('#submit').attr("disabled", "disabled");
					alert("起止时间大于结束时间！");
				} else {
					if ($start.val().length == 0) {
						$('#submit').attr("disabled", "disabled");
						alert("请输入开始时间！");
					}
				}
			}
		}
	}
	function searchName() {
		var $start = $('#start');
		var $end = $('#end');
		if ($('#emp').val()) {
			if ($start.val() > $end.val()) {
				$('#submit').attr("disabled", "disabled");
			} else {
				$('#submit').removeAttr("disabled");
			}
		}
	}
</script>
</head>
<body>
	<jsp:include page="../menu/menue.jsp"></jsp:include>
	<div class="detailForm">
		<h4 class="ui left floated detail ">学员缴费详情</h4>
		<div class="ui clearing divider"></div>
		<div class="ui grid" style="margin-bottom: 20px;">
			<div class="two wide column">学员:${student.name }</div>
			<div class="three wide column">学员等级：${student.stuGradeText }</div>
			<div class="three wide column">学制：${student.classTypeText}</div>
			<div class="two wide column">咨询师：${student.counselorName}</div>
			<div class="four wide column" style="margin-left: 53px;">身份证：${student.idCard }</div>
			<div class="two wide column" style="color: red;">学费：${po.duePay }</div>
			<div class="three wide column">缴费方式：${po.payWayText}</div>
			<div class="three wide column">总缴：${po.havePay }</div>
			<div class="two wide column" style="color: red;">未缴：${po.noPay }</div>
			<div class="two wide column" style="margin-left: 53px;">缴费次数：${po.payCount }</div>
		</div>
		<form class="form">
			<input type="hidden" name="stuId" value="${student.id }">
			<table class="ui celled table">
				<tbody>
					<tr>
						<td>收款员工： <input type="text" id="emp" onchange="searchName()" value="${param.empName}"
							name="empName" onkeyup="searchName()">
						</td>
						<td><span>起止时间：</span> <input type="text" id="start"
							onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
							class="Wdate" style="width: 150px;" name="startTime"
							onchange="searchTime()" value="${start}" /></td>
						<td><span>结束时间：</span> <input type="text" id="end"
							onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
							class="Wdate" style="width: 150px;" name="endTime" value="${end}"
							onchange="searchTime()" /></td>
						<td>
							<button class="ui button" tabindex="0" type="submit" id="submit"
								style="text_align: center;" onclick="search()">查询</button>
						</td>
					</tr>
				</tbody>
			</table>
		</form>
		<c:if test="${empty studentPayList }">
		<div class="ui segment" style="text-align: center;">没有记录</div>
		</c:if>
		<c:forEach var="student" items="${ studentPayList}">
			<div class="ui segment">
				<div class="ui grid">
					<div class="column"  style="color: red;">缴费单号：${student.payOrderId }</div>
				</div>
				<div class="ui grid">
					<div class="four wide column">收款员工：${student.empName }</div>
					<div class="four wide column">缴费金额：${student.thisPay }</div>
					<div class="four wide column">收款时间：<fmt:formatDate value="${student.payDate}" type="both"/></div>
				</div>
				
			</div>
		</c:forEach>
		<c:if test="${totalPage > 1 }">
			<div class="page">
				<a <c:if test="${page!=1}">href="${url}?page=1${queryString}"</c:if>
					class="${page == 1?'disable':''}">首页</a> <a
					<c:if test="${page!=1}">href="${url}?page=${page-1}${queryString}"</c:if>
					class="${page == 1?'disable':''}">上一页</a> <a
					<c:if test="${page!=totalPage}">href="${url}?page=${page+1 }${queryString}"</c:if>
					class="${page == totalPage?'disable':''}">下一页</a> <a
					<c:if test="${page!=totalPage}">href="${url}?page=${totalPage }${queryString}"</c:if>
					class="${page == totalPage?'disable':''}">最后一页</a> <span>
					${page}/${totalPage} </span>
			</div>
		</c:if>
	</div>
</body>
</html>